package cn.ekuma.epos.bean.util;

import com.openbravo.bean.PaymentsModel;
import com.openbravo.format.Formats;

public class PaymentsModelHelper {

	public static String printHost(PaymentsModel p) {
        return p.getHost();
    }
    public static String printSequence(PaymentsModel p) {
        return Formats.INT.formatValue(p.getM_iSeq());
    }
    public static String printDateStart(PaymentsModel p) {
        return Formats.TIMESTAMP.formatValue(p.getM_dDateStart());
    }
    public static String printDateEnd(PaymentsModel p) {
        return Formats.TIMESTAMP.formatValue(p.getM_dDateEnd());
    }  
    
    public static String printPayments(PaymentsModel p) {
        return Formats.INT.formatValue(p.getM_iPayments());
    }

    public static String printPaymentsTotal(PaymentsModel p) {
        return Formats.CURRENCY.formatValue(p.getM_dPaymentsTotal());
    }

    public static String printName(PaymentsModel p){
        return p.getM_sName();
    }

    public static String printHandCash(PaymentsModel p) {
        return Formats.CURRENCY.formatValue(p.getM_dHandCash());
    }

    public static String printMemo(PaymentsModel p) {
        return p.getMemo();
    }
    
    public static String printSales(PaymentsModel p) {
        return Formats.INT.formatValue(p.getM_iSales());
    }
    public static String printSalesBase(PaymentsModel p) {
        return Formats.CURRENCY.formatValue(p.getM_dSalesBase());
    }     
    public static String printSalesTaxes(PaymentsModel p) {
        return Formats.CURRENCY.formatValue(p.getM_dSalesTaxes());
    }     
    public static String printSalesTotal(PaymentsModel p) {            
        return Formats.CURRENCY.formatValue((p.getM_dSalesBase() == null || p.getM_dSalesTaxes() == null)
                ? null
                : p.getM_dSalesBase() + p.getM_dSalesTaxes());
    }     
}
